package net.app.zoneland.oauth.enums;

import lombok.Data;
import org.springframework.util.StringUtils;

/**
 * @Description OAUTH2.0常见的错误类型
 * @Author CJB
 * @CreateTime 2020/12/28 22:57
 * @Version: 1.0
 */
public enum OAuthEnums {

    INVALID_SCOPE_CODE("invalid_scope","无效授权范围"),INVALID_CLIENT_CODE("invalid_client","无效客户端"),UNAUTHORIZED_CLIENT_CODE("unauthorized_client","未授权的客户端"),
    INVALID_GRANT_CODE("invalid_grant","无效授权类型"),INVALID_TOKEN_CODE("invalid_token","无效的token")
    ,INVALID_REQUEST_CODE("invalid_request","无效的请求")
    ,REDIRECT_URI_CODE("redirect_uri_mismatch","回调地址有误")
    ,UNSUPPORTED_GRANT_CODE("unsupported_grant_type","不支持的授权类型")
    ,UNSUPPORTED_RESPONSE_CODE("unsupported_response_type","不支持的响应类型")
    ,ACCESS_DENIDE_CODE("access_denied","拒绝访问");

    private String errorCode;

    private String message;

    private OAuthEnums(String errorCode,String message){
        this.errorCode=errorCode;
        this.message=message;
    }

    public String getErrorCode(){
        return this.errorCode;
    }

    public String getMessage(){
        return this.message;
    }

    public void setErrorCode(String errorCode){
        this.errorCode=errorCode;
    }

    public void setMessage(String message){
        this.message=message;
    }
}
